package com.cetc39.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.cetc39.bean.Device;
import com.cetc39.dao.DeviceDao;

public class DeviceDaoImpl extends HibernateDaoSupport implements DeviceDao {

	@Override
	public void saveDev(Device dev) {
		this.getHibernateTemplate().save(dev);
	}

	@Override
	public void updateDev(Device dev) {
		this.getHibernateTemplate().saveOrUpdate(dev);
	}

	@Override
	public List<?> findAllDev() {
		return this.getHibernateTemplate().find("FROM Device");
	}

	@Override
	public Device findByDevId(int id) {
		return this.getHibernateTemplate().get(Device.class, id);
	}

}
